import common from "@/validator/common";

const name = [
  common.getRequiredRule('教室名'),
  {
    type: 'string',
    min: 2,
    max: 30,
    message: '教室名需在2 - 30个字符之间'
  }
]

const number = [
  common.getRequiredRule('可容纳人数'),
  ...common.getPositiveIntegerRules('可容纳人数')
]

const buildId = [
  common.getRequiredRule('所属楼栋'),
]

const status = [
  common.getRequiredRule('当前状态'),
]

export default {
  insertRules: {
    name,
    number,
    buildId,
    status
  },
  updateRules: {
    name,
    number,
    buildId,
    status
  }
}
